package com.example.demo.controller;


import com.example.demo.entity.Activity;
import com.example.demo.pojo.PlannerResult;
import com.example.demo.repository.JoinerRepository;
import com.example.demo.service.HomeService;
import com.example.demo.vo.JoinerVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/home")
public class HomeController {
    @Autowired
    JoinerRepository joinerRepository;

    @Autowired
    HomeService homeService;

    //退出
    @GetMapping ("/exit")
    public PlannerResult<String> exit_act(@RequestParam("userid") Integer userid,@RequestParam("/actid") Integer actid )
    {
        return homeService.exit_act(userid,actid);
    }

    //我加入的活动
    @GetMapping ("/myjoin")
    public PlannerResult<List<Activity>> my_join_activity(@RequestParam("userid") Integer userid)
    {
        return homeService.my_act_join(userid);
    }

    //我创建的活动
    @GetMapping ("/mycrerate")
    public PlannerResult<List<Activity>> my_create_activity(@RequestParam("userid")Integer userid)
    {
        return homeService.my_act_create(userid);
    }
}
